/*
 * File:   Example2.java
 * Author: Oleg S. Estekhin
 */
package dht.emulator.example;

import java.util.ArrayList;
import java.util.List;

import dht.emulator.DefaultNode;
import dht.emulator.Identifier;
import dht.emulator.Node;

public class Example2
{

    public static void main(String[] args)
    {
        List<Node> nodes = new ArrayList<Node>();
        int size = 10;
        Node previous = null;
        for (int i = 0; i < size; i++)
        {
            List<Node> knownNodes = new ArrayList<Node>();
            if (previous != null)
            {
                knownNodes.add(previous);
            }

            Node node = new DefaultNode(Identifier.randomIdentifier(4), knownNodes);
            for (Node n : node.getNodes())
            {
                n.getQuality(node);
            }

            nodes.add(node);
            if (previous == null)
            {
                previous = node;
            }
        }
        for (Node node : nodes)
        {
            System.out.println(node);
        }
    }

}